<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
	</head>
	<body>
		<img src="img/1.jpg" id="imga"><br><br>
		<button type="button" onclick="kais()" style=" margin-left: 25px;" id="but">开始</button>
		
	</body>
	<script type="text/javascript">
		var imgb=document.getElementById('imga')
		var butt=document.getElementById('but')
		function kais(){
		var bb= setInterval(function(){
				//创建数组储存照片
				var sz=["img/1.jpg","img/2.jpg","img/3.jpg","img/4.jpg","img/5.jpg","img/6.jpg","img/7.jpg","img/8.jpg","img/9.jpg","img/10.jpg"]
				var random=Math.floor(Math.random()*sz.length);
				imgb.src=sz[random];
				
			},300)
		}
		
	</script>
</html>
